import request from '@/axios'
import type {
  AnalysisTotalTypes,
  UserAccessSource,
  WeeklyUserActivity,
  MonthlySales,
  Project
} from './types'

export const getCountApi = (data?: { yearOrDay?: string, fromDay?: string }): Promise<IResponse<AnalysisTotalTypes[]>> => {
  return request.post({ url: '/api/v2/board/profile.do', data })
}

export const getUserAccessSourceApi = (data?: Partial<MonthlySales>): Promise<IResponse> => {
  return request.post({ url: '/api/v2/board/grpinc.do', data })
}

export const getWeeklyUserActivityApi = (data: Partial<WeeklyUserActivity>): Promise<IResponse> => {
  return request.post({ url: '/api/v2/board/week.do', data })
}

export const getMonthlySalesApi = (data: Partial<MonthlySales>): Promise<IResponse> => {
  return request.post({ url: '/api/v2/board/month.do', data })
}
export const getProjectApi = (data?: { day?: string }): Promise<IResponse<Project[]>> => {
  return request.post({ url: '/api/v1/prj/getsymbol.do', data })
}
export const postDay15Api = (data: Partial<MonthlySales>): Promise<IResponse> => {
  return request.post({ url: '/api/v2/board/day15.do', data })
}

export const postPrjincApi = (data: Partial<MonthlySales>): Promise<IResponse> => {
  return request.post({ url: '/api/v2/board/prjinc.do', data })
}
//操手收益比例
export const postOprincApi = (data: Partial<MonthlySales>): Promise<IResponse> => {
  return request.post({ url: '/api/v2/board/oprinc.do', data })
}
//小组月表
export const postGrpmonthApi = (data: Partial<MonthlySales>): Promise<IResponse> => {
  return request.post({ url: '/api/v2/board/grpmonth.do', data })
}
//小组日表
export const postGrpdayApi = (data: Partial<MonthlySales>): Promise<IResponse> => {
  return request.post({ url: '/api/v2/board/grpday.do', data })
}